import axios from 'axios'
var mets = {
    //播放歌曲
    playMusic: function (musicId) {
        var that = this;
        axios.get("https://autumnfish.cn/song/url?id=" + musicId)
            .then(function (response) {
                console.log(response.data.data[0].url)
                that.musicUrl = response.data.data[0].url;

            }, function (err) {
                console.log(err);
            });
        //歌曲封面
        axios.get("https://autumnfish.cn/song/detail?ids=" + musicId)
            .then(function (response) {
                that.picUrl = response.data.songs[0].al.picUrl;

            }, function (err) {
                console.log(err);
            });
    },
    //搜索歌曲
    searchMusic: function (musicName) {
        var that = this;
        axios.get("https://autumnfish.cn/search?keywords=" + musicName)
            .then(function (response) {
                that.musicList = response.data.result.songs;
                // console.log(response.data.result.songs)
            }, function (err) {
                console.log(err);
            });
    },
    palyNext: function () {

    },
    run: function () {
        console.log("一个尝试" + this.data)
    },


}
export { mets }